package com.zhipu.balance.ui.home.system.number

import android.os.Bundle
import androidx.lifecycle.ViewModelProvider
import androidx.recyclerview.widget.LinearLayoutManager
import com.zhipu.balance.R
import com.zhipu.balance.databinding.ActivityNumberManagementBinding
import com.zhipu.balance.ui.BaseActivity
import com.zhipu.balance.ui.vm.home.system.number.NumberManagementViewModel
import com.zhipu.balance.utils.InitializeUtils

/**
 * 编号管理
 */
class NumberManagementActivity : BaseActivity<ActivityNumberManagementBinding>(){


    //VM
    var mNumberManagementViewModel: NumberManagementViewModel? = null

    override fun initCreate() {
        super.initCreate()
        InitializeUtils.AppComponent()?.doInjectionMain(this)
        mNumberManagementViewModel = ViewModelProvider(this, viewModelFactory)[NumberManagementViewModel::class.java]
    }




    /**
     * 初始化根布局
     *
     * @return 布局layout的id
     */
    override fun initContentView(savedInstanceState: Bundle?): Int {
        return R.layout.activity_number_management
    }


    override fun initView() {
        super.initView()
        binding.viewModel = mNumberManagementViewModel
        binding.rv.layoutManager = object : LinearLayoutManager(mContext) {}
        binding.rv.adapter = mNumberManagementViewModel?.mNumberManagementAdapter
    }
}